package com.lungle.warmdiary.app.api.remote;


import com.lungle.warmdiary.app.model.Result;
import com.lungle.warmdiary.app.model.response.Image;

import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 *@author sbbic
 *created at 2016/9/7 0:26
 */
public interface FileApi {
    @Multipart
    @POST("mobile/upload")
    Observable<Result<Image>> upload(@Part MultipartBody.Part file);

    @GET
    Observable<ResponseBody> downloadPicture(@Url String fileUrl);


    @Multipart
    @POST("upload/upload")
    Observable<Result<Image>> upload(@PartMap Map<String, MultipartBody.Part> map);


}
